From 9218d22954d61296a32c49373ab0f17f0be59cfe Mon Sep 17 00:00:00 2001 From: zwlucas Date: Fri, 29 May 2026 17:41:33 -0300 Subject: feat: add SSL info tracking and server metrics collection Signed-off-by: zwlucas --- frontend/src/routes/status/[id]/+page.svelte | 44 ++++++++++++++++++++++++++++ frontend/src/routes/status/[id]/+page.ts | 9 ++++-- 2 files changed, 50 insertions(+), 3 deletions(-) (limited to 'frontend/src/routes/status/[id]') diff --git a/frontend/src/routes/status/[id]/+page.svelte b/frontend/src/routes/status/[id]/+page.svelte index 0701eeb..d47797d 100644 --- a/frontend/src/routes/status/[id]/+page.svelte +++ b/frontend/src/routes/status/[id]/+page.svelte @@ -126,6 +126,50 @@ {/if} + + {#if data.sslInfo} + {@const ssl = data.sslInfo} + {@const isExpiring = ssl.days_remaining < 7} +
+
+
+ + + +
+
+
+

+ Segurança SSL/TLS +

+ + {ssl.days_remaining >= 0 ? 'Válido' : 'Expirado'} + +
+

+ {ssl.issuer} +

+

+ {ssl.days_remaining >= 0 + ? isExpiring + ? '⚠ Certificado expira em ' + ssl.days_remaining + ' dia' + (ssl.days_remaining === 1 ? '' : 's') + : 'Certificado válido por mais ' + ssl.days_remaining + ' dias' + : '⚠ Certificado expirado há ' + Math.abs(ssl.days_remaining) + ' dias'} +

+
+
+
+ {/if} +
{#if stats} diff --git a/frontend/src/routes/status/[id]/+page.ts b/frontend/src/routes/status/[id]/+page.ts index 1b91c67..13a72b1 100644 --- a/frontend/src/routes/status/[id]/+page.ts +++ b/frontend/src/routes/status/[id]/+page.ts @@ -3,10 +3,11 @@ import type { PageLoad } from './$types'; export const load: PageLoad = async ({ params, fetch }) => { const id = params.id; - const [servicesRes, historyRes, statsRes] = await Promise.all([ + const [servicesRes, historyRes, statsRes, sslRes] = await Promise.all([ fetch(`http://localhost:8080/api/services`).catch(() => null), fetch(`http://localhost:8080/api/services/${id}/history`).catch(() => null), - fetch(`http://localhost:8080/api/services/${id}/stats`).catch(() => null) + fetch(`http://localhost:8080/api/services/${id}/stats`).catch(() => null), + fetch(`http://localhost:8080/api/services/${id}/ssl`).catch(() => null) ]); const services = servicesRes?.ok ? await servicesRes.json() : []; @@ -14,10 +15,12 @@ export const load: PageLoad = async ({ params, fetch }) => { const historyJson = historyRes?.ok ? await historyRes.json() : []; const history = Array.isArray(historyJson) ? historyJson : (historyJson.data ?? []); const stats = statsRes?.ok ? await statsRes.json() : null; + const sslInfo = sslRes?.ok ? await sslRes.json() : null; return { service: svc ?? null, history, - stats + stats, + sslInfo }; }; -- cgit v1.2.3